import http from '@/utils/request'

//前台获取器材详细信息
export async function getEquipmentApi(parm){
  return await http.getRestApi("/equipment",parm)
}

//前台根据条件获取器材列表
export async function getValidEquipmentListApi(parm){
  return await http.get("/equipment",parm)
}

//后台根据条件获取器材列表
export async function getEquipmentListApi(parm){
  return await http.get("/equipment/list",parm)
}

//新增器材
export async function addEquipmentApi(parm){
  return await http.post("/equipment",parm)
}

//批量导入
export async function addEquipmentBatchApi(parm){
  return await http.upload("/equipment/batch/import",parm)
}

//编辑器材
export async function editEquipmentApi(parm){
  return await http.put("/equipment",parm)
}

//修改状态
export async function editEquipmentStatusApi(parm) {
  return await http.put("/equipment/status", parm)
}

//删除器材
export async function deleteEquipmentApi(parm){
  return await http.delete("/equipment",parm)
}

//批量删除器材
export async function deleteEquipmentBatchApi(parm){
  return await http.delete("/equipment/batch/delete",parm)
}

//////////租借记录部分///////////

//检查是否有超时租借
export async function checkOutTimeApi(parm){
  return await http.getRestApi("/equipmentRent/out",parm)
}

//后台获取租借记录
//获取器材租借全部信息
export async function getAllEquipmentRentApi(parm){
  return await http.get("/equipmentRent/list",parm)
}

//新增租借记录
export async function addEquipmentRentApi(parm){
  return await http.post("/equipmentRent",parm)
}

//修改状态
export async function editRentStatusApi(parm) {
  return await http.put("/equipmentRent", parm)
}

//删除器材租借记录
export async function deleteEQRentApi(parm){
  return await http.delete("/equipmentRent",parm)
}


/////////购买记录部分//////////////
//获取器材租借全部信息
export async function getAllEquipmentBuyApi(parm){
  return await http.get("/equipmentBuy/list",parm)
}

//修改状态
export async function editBuyStatusApi(parm) {
  return await http.put("/equipmentBuy", parm)
}

//添加购买信息
export async function addEquipmentBuyApi(parm){
  return await http.post("/equipmentBuy",parm)
}

//删除器材购买记录
export async function deleteEQBuyApi(parm){
  return await http.delete("/equipmentBuy",parm)
}


///////////器材袋部分//////////////
//查看器材袋的器材信息
export async function getEquipmentBagInfoApi(parm){
  return await http.getRestApi("/equipmentBag",parm)
}

//查看器材袋的器材数量
export async function getEquipmentBagNumberApi(parm){
  return await http.getRestApi("/equipmentBag/number",parm)
}

//放入器材袋
export async function addEquipmentBagApi(parm){
  return await http.post("/equipmentBag",parm)
}

//修改器材袋器材数量
export async function editEquipmentBagApi(parm) {
  return await http.put("/equipmentBag", parm)
}

//删除器材购买记录
export async function deleteBagApi(parm){
  return await http.delete("/equipmentBag",parm)
}
